package database

type BasicType uint

const (
	Bool BasicType = iota
	Int
	Uint
	Float
	String
)

func (bt BasicType) String() string {
	switch bt {
	case Bool:
		return "bool"
	case Int:
		return "int"
	case Uint:
		return "uint"
	case Float:
		return "float"
	case String:
		return "string"
	default:
		panic("unknown basic type")
	}
}

func (bt BasicType) ToPgType() string {
	switch bt {
	case Bool:
		return "BOOL"
	case Int:
		return "INT"
	case Uint:
		return "INT"
	case Float:
		return "FLOAT"
	case String:
		return "TEXT"
	default:
		panic("Impossible!")
	}
}

type ComplexType uint

const (
	Array ComplexType = iota
	Slice
	Struct
)
